using System;
/// <summary>
/// AbsHFMetaObject【IHFRecycle接口】
/// </summary>
public partial class AbsHFMetaObject : IHFRecycle, IHFRecycleEventHandler
{
    public event Action<IHFRecycle> OnAfterRecycleHandler;
    public event Action<IHFRecycle> OnBeforeRecycleHandler;
    #region IHFIRecycle    
    /// <summary>
    /// 回收
    /// </summary>
    public void Recycle()
    {
        OnBeforeRecycleHandler?.Invoke(this);
        OnBeforeRecycleHandler = null;
        OnRecycle();
        OnAfterRecycleHandler?.Invoke(this);
        OnAfterRecycleHandler = null;
    }
    
    /// <summary>
    /// 回收
    /// </summary>
    protected virtual void OnRecycle() { }
   
    #endregion
}